SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE VIEW [dbo].[TMPROV_RTPS]            
As             
Select T1.CO_EMPR 'CO_EMPR_RTPS', T1.CO_AUXI_EMPR 'CO_PROV_RTPS', T1.NO_AUXI 'NO_PROV_RTPS', T1.AP_PATE_AUXI 'AP_PATE_RTPS', T1.AP_MATE_AUXI 'AP_MATE_RTPS',            
IsNull(T1.NO_NATU_AUX1,'') +' '+ IsNull(T1.NO_NATU_AUX2,'') 'NO_EMPL_RTPS', T1.NU_RUCS,  
T1.CO_DOCU_SUNA 'CO_DOSU_RTPS', T1.NU_DOCU_SUNA 'NU_DOSU_RTPS',             
T1.NU_TLFN 'NU_TLF1_RTPS', T1.DE_DIRE_MAIL 'DE_MAIL_RTPS', T1.DE_REFE 'DE_REFE_RTPS', T1.CO_UBIC_GEOG 'CO_UBIC_RTPS'          
From OFISEGU..TMAUXI T1-- , OFILOGI..TDDIRE_PROV T2            
Where t1.TI_AUXI_EMPR = 'P'    

GO
